import axios from "../utils/axios";
export const listArticle = (article)=>{
    return axios({
        url: "/article/showAll",
        method: 'post',
        data: article
    })
}
// 根据文章id ,查文章的内容
export const  showArticle = (id)=>{

    return axios({
        url: `/article/${id}`,
        method: 'get'
    })
}

// 根据用户id查, 该用户发布的全部文章
export const listArticleById =(uid)=>{
    return axios({
        url:`/article/showAllByUid/${uid}`,
        method:'get'
    })

}
// 更改文章内容
export const changeArticle =(article) =>{
    return axios({
        url:'/article',
        method:'put',
        data: article
    })
}
// 新增文章
export const insertArticle= (article)=>{
    return axios({
        url:'/article',
        method:'post',
        data:article
    })
}
export const deleteArticleById =(id)=>{
    return axios({
        url: `/article/${id}`,
        method:'delete'
    })
}